package com.zxl.designpattern.creator.factory.methodpattern;

import com.zxl.designpattern.creator.factory.pojo.Phone;

/**
 * @author zxl
 * @version 1.0
 * @description 工厂方法-手机店
 * @date 2025/5/31 18:56
 */
public class FactoryMethodStore {


    private IPhoneFactory factory;

    public void setFactory(IPhoneFactory factory) {
        this.factory = factory;
    }
    /**
     * 买手机
     * @return
     */
    public Phone buyPhone() {

        //从工厂获取手机
        Phone coffee = factory.createPhone();

        return coffee;
    }
}
